package com.cola.custSpeechTranscription;

import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;

/**
 * @BelongsProject: custSpeechTranscription
 * @BelongsPackage: com.cola.custSpeechTranscription
 * @Author: jiangkang
 * @CreateTime: 2025-11-03  09:52
 * @Description: TODO
 * @Version: 1.0
 */
public class Tets1103 {

    public static void main(String[] args) {
        // 原始时间字符串
        String timeStr = "2025-11-03 09:19:06";
        String s = plusMinutes(timeStr, "60");
        System.out.println(s);
    }

    public static String plusMinutes(String timeStr,String minutes) {
        int parseInt = Integer.parseInt(minutes);
        // 定义格式化器
        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");

        // 解析字符串为 LocalDateTime
        LocalDateTime dateTime = LocalDateTime.parse(timeStr, formatter);

        // 加上10分钟
        LocalDateTime newDateTime = dateTime.plusMinutes(parseInt);

        String result = newDateTime.format(formatter);

        return result;
    }
}